package com.xuecheng.content.api;

import com.xuecheng.content.model.dto.CoursePreviewDto;
import com.xuecheng.content.service.CoursePublishService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: chenheng
 * @Date: 2023/12/27 14:36
 */
@RestController
@RequestMapping("/open")
@Api(value = "课程公开查询接口",tags = "课程公开查询接口")
@Slf4j
public class CourseOpenController {
    @Autowired
    CoursePublishService coursePublishService;
    @ApiOperation("根据courseId查询课程信息列表")
    @GetMapping("/course/whole/{courseId}")
    public CoursePreviewDto getPreviewInfo(@PathVariable Long courseId){
        return coursePublishService.getCoursePreviewInfo(courseId);
    }
}
